import request from "@/utils/request";

// 获取角色基本列表（带检索功能）
export const apiGetRoleList = ({page,limit,roleName})=>request(`/admin/acl/role/${page}/${limit}`,{params:{roleName}})

// 添加或修改角色
export const apiAddOrEditRoleInfo = data=>{
  if(data.id) {
    // 修改角色名
    return request.put('/admin/acl/role/update',data)
  }else {
    return request.post('/admin/acl/role/save',data)
  }
}

// 删除角色
export const apiDeleteRole = id =>request.delete(`/admin/acl/role/remove/${id}`)

// 批量删除角色 /admin/acl/role/batchRemove
export const apiBatchDelRole = idList=>{
  return request({
    method:'delete',
    url:'/admin/acl/role/batchRemove',
    data: idList
  })
}

